package scuba.DiveBuddy.Adapters;

import android.support.v4.app.*;
import scuba.DiveBuddy.Core.Core;
import scuba.DiveBuddy.Fragments.NewLogEntry.LogDataFragment;
import scuba.DiveBuddy.Fragments.NewLogEntry.LogLocationFragment;
import scuba.DiveBuddy.Fragments.NewLogEntry.LogProfileFragment;

/**
 * @author Alex Anderson
 * @version 1.0
 * @since {26/02/14}
 */
public class LogEditorAdapter extends FragmentPagerAdapter {
    public static final int NUMBER_OF_TABS = 3;

    public LogEditorAdapter(FragmentManager fm) {
        super(fm);
    }


    @Override
    public int getCount() {
        return NUMBER_OF_TABS;
    }

    @Override
    public Fragment getItem(int index) {
        switch(index)
        {
            case Core.LOGPAGEID_PROFILE:
                return new LogProfileFragment();
            case Core.LOGPAGEID_DATA:
                return new LogDataFragment();
            case Core.LOGPAGEID_LOCATION:
                return new LogLocationFragment();
        }

        return null;
    }
}
